﻿#include "oeasyproxy.h"
#include <QTextCodec>
#include <QMetaType>
#include <QDebug>

#include "singleapplication.h"
#ifdef NO_WIDGETS
#include <QtCore/qcoreapplication.h>
#else
#include <QApplication>
#endif

int main(int argc, char *argv[])
{
#ifndef SINGLE_APPLICATION
    QApplication a(argc, argv); //多例
#else

    SingleApplication a(argc, argv); //单例
    if(a.isRunning())
    {
        QDateTime dateTime = QDateTime::currentDateTime();
        QString dateTimeStr = dateTime.toString("yyyy-MM-dd_hh_mm_ss_zzz");
        qDebug()<<"isruning:"<<a.GetAppName()<<dateTimeStr;
        return 0;
    }
#endif


    QTextCodec::codecForName("utf-8");//GBK
    qRegisterMetaType<TRANSFER_INFO>("TRANSFER_INFO");
    OeasyProxy w;
#ifndef NO_WIDGETS
    w.show();
#else
    Q_UNUSED(w);
#endif

    return a.exec();
}

